<template>
    <div  style="line-height:50px">
      <el-table
        :data="tableData" 
        style="">
        <el-table-column type="expand">
          <template slot-scope="props">
            <el-form label-position="left" inline class="demo-table-expand">
              <el-form-item label="车库名字">
                <span>{{ props.row.name }}</span>
              </el-form-item>
              <el-form-item label="车位图片">
                <span>{{ props.row.shop }}</span>
              </el-form-item>
              <el-form-item label="车位 编号">
                <span>{{ props.row.id }}</span>
              </el-form-item>
              <el-form-item label="店铺 ID">
                <span>{{ props.row.shopId }}</span>
              </el-form-item>
              <el-form-item label="商品分类">
                <span>{{ props.row.category }}</span>
              </el-form-item>
              <el-form-item label="车位地址">
                <span>{{ props.row.address }}</span>
              </el-form-item>
              <el-form-item label="车位描述">
                <span>{{ props.row.desc }}</span>
              </el-form-item>
            </el-form>
          </template>
    </el-table-column>
    <el-table-column
      label="商品 ID"
      prop="id">
    </el-table-column>
    <el-table-column
      label="车库名称"
      prop="name">
    </el-table-column>
      <el-table-column
      label="车库地址"
      prop="desc">
    </el-table-column>
    <el-table-column
      label="车库描述"
      prop="discribe">
    </el-table-column>

    <el-table-column
      label="操作"
      prop="desc">
      <template slot-scope="scope">
        <el-button type="text" size="small" @click="change(scope.row)">编辑</el-button>
      </template>

    </el-table-column>
  </el-table>
      

  <el-dialog
  title="提示"
  :visible.sync="dialogVisible"
  width="30%"
  :before-close="handleClose">
      <el-form ref="form" :model="form" label-width="80px">
  <el-form-item label="车库名字">
    <el-input v-model="form.name"></el-input>
  </el-form-item>
  <el-form-item label="车库区域">
    <el-select v-model="form.region" placeholder="请选择活动区域">
      <el-option label="重庆" value="shanghai"></el-option>
      <el-option label="上海" value="beijing"></el-option>
      <el-option label="北京" value="beijing"></el-option>
      <el-option label="云南" value="beijing"></el-option>
    </el-select>
  </el-form-item>

  <el-form-item label="是否开租">
    <el-switch v-model="form.delivery"></el-switch>
  </el-form-item>
  <el-form-item label="车位描述">
    <el-input type="textarea" v-model="form.desc"></el-input>
  </el-form-item>
  <el-form-item>
    <el-button type="primary" @click="onSubmit">立即创建</el-button>
    <el-button  @click="cancel">取消</el-button>
  </el-form-item>
</el-form>
</el-dialog>
    </div>
</template>

<script>
export default {
    name:"propertyCart",
     methods: {
      handleClick(row) {
        console.log(row);
      },
      change(){
        this.dialogVisible=true
      },
      onSubmit(){
        this.dialogVisible=false
      },
      cancel(){
        this.dialogVisible=false
      }
    },

    data() {
      return {
        dialogVisible: false,

        
         form: {
          name: '',
          region: '',
          date1: '',
          date2: '',
          delivery: false,
          type: [],
          resource: '',
          desc: ''
        },
        tableData: [
          {
          date: '2016-05-02',
          province: '上海',
          city: '普陀区',
          address: '上海市普陀区金沙江路',
          discribe:"位居海边，360度无死角监控",
          status: "正常",
          id: '12987122',
          name: '好滋好味鸡蛋仔',
          category: '江浙小吃、小吃零食',
          desc: '上海市普陀区金沙江路',
          shop: '王小虎夫妻店',
          shopId: '10333'
        },
        ]
      }
    }
     }
</script>


<style>
  .demo-table-expand {
    font-size: 0;
  }
  .demo-table-expand label {
    width: 90px;
    color: #99a9bf;
  }
  .demo-table-expand .el-form-item {
    margin-right: 0;
    margin-bottom: 0;
    width: 50%;
  }
</style>